#include "Task.h"
#include "TaskQueue.h"
#include "ThreadPoll.h"
#include "TaskOne.h"

void test()
{
    //创建任务
    unique_ptr<Task> ptask(new TaskOne());
    //创建线程池
    ThreadPoll poll(4,10);
    //开启线程池
    poll.start();
    //传入多个任务
    int cnt = 20;
    while(cnt--)
    {
        poll.addTask(ptask.get());
        cout << "cnt = " << cnt << endl;
    }
    poll.stop();


}
int main(int argc, char *argv[])
{
    test();
    return 0;
}

